package br.com.schs.sessionbeans;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import br.com.schs.entity.HorarioTrabalho;

@Stateless
public class HorarioTrabalhoSesseionBean {

	@PersistenceContext
	private EntityManager entityManager;

	@SuppressWarnings("unchecked")
	public List<HorarioTrabalho> consultarTodosHorariosTrabalho() {
		Query query = entityManager.createNamedQuery("HorarioTrabalho.consultarTodosHorariosTrabalho");
		try {
			return query.getResultList();
		} catch (NoResultException e) {
			return null;
		}
	}

}
